CSharpTest.Net
EnumerateFrom Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.BPlusTree Assembly > CSharpTest.Net.Collections Namespace > BPlusTree<TKey,TValue> Class : EnumerateFrom Method

start

Glossary Item Box

Inclusivly enumerates from start key to the end of the collection

Syntax

Visual Basic (Declaration) 
Public Function EnumerateFrom( _
   ByVal start As TKey _
) As IEnumerable(Of KeyValuePair(Of TKey,TValue))
C# 
public IEnumerable<KeyValuePair<TKey,TValue>> EnumerateFrom( 
   TKey start
)

Parameters

start

Example

BPlusTree/BPlusTree.Test/BasicTests.cs

C#Copy Code
using (BPlusTree<int, string> data = Create(Options))
{
    for (int i = 0; i < 100; i++)
        data.Add(i, i.ToString());

    Assert.AreEqual(50, new List<KeyValuePair<int, string>>(data.EnumerateFrom(50)).Count);
    Assert.AreEqual(25, new List<KeyValuePair<int, string>>(data.EnumerateFrom(75)).Count);

    for (int i = 0; i < 100; i++)
    {
        int first = -1;
        foreach (KeyValuePair<int, string> kv in data.EnumerateFrom(i))
        {
            first = kv.Key;
            break;
        }
        Assert.AreEqual(i, first);
    }
}
VB.NETCopy Code
Using data As BPlusTree(Of Integer, String) = Create(Options)
    Dim i As Integer = 0
    While i < 100
        data.Add(i, i.ToString())
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
    End While

    Assert.AreEqual(50, New List(Of KeyValuePair(Of Integer, String))(data.EnumerateFrom(50)).Count)
    Assert.AreEqual(25, New List(Of KeyValuePair(Of Integer, String))(data.EnumerateFrom(75)).Count)

    Dim i As Integer = 0
    While i < 100
        Dim first As Integer = -1
        For Each kv As KeyValuePair(Of Integer, String) In data.EnumerateFrom(i)
            first = kv.Key
            Exit For
        Next
        Assert.AreEqual(i, first)
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
    End While
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys